<template>
  <div class="header-song-list  flex items-center h-15">
    <img class="w-10 h-10" :src="songList?.avatarUrl" alt="">
    <span class="yu-color-text yu-textColor-hover cursor-pointer">
      <span class="ml-2" @click="jumpUser(songList.userId)">{{ songList?.nickname }}</span>
      <img
          v-if="songList?.avatarDetail?.identityIconUrl"
          class="w-4 h-4"
          :src="songList?.avatarDetail?.identityIconUrl" alt="">
    </span>
    <span class="yu-color-text text-sm ml-2">{{ timestampToYMD(createTime) }}创建</span>
  </div>
</template>

<script setup>
import {timestampToYMD} from "@/utils/index"
import {useRouter} from "vue-router";
const router = useRouter()
defineProps({
  songList: Object,
  createTime: Number
})

// 跳转到用户页面
const jumpUser = (id) => {
  router.push({
    path: '/user/homepage',
    query: {
      id
    }
  })
}

</script>

<style scoped>

</style>
